int isShake;
bool lastWasRight;
void GetInputs ()
{
  if(digitalRead(leftInput) == LOW)
  {
    if(lastLeft == 0)
    {
      lastLeft = millis();
    }
    tempLeft = true;

    if(tempRight && lastWasRight)
    {
      Serial.println(isShake);
      isShake++;
    }
    lastWasRight = false;
    tempRight = false;
  }
  if(digitalRead(rightInput) == LOW)
  {
    if(lastRight == 0)
    {
      lastRight = millis();
    }
    tempRight = true;

    if(tempLeft && !lastWasRight)
    {
      Serial.println(isShake);
      isShake++;
    }
    lastWasRight = true;
    tempLeft = false;
  }

  if(isShake >= shakeNeeded)
  {
    Serial.println("######### SHAKE!!! ########");
    ResetInputs();
    shakeActive = true;
  }

  if(tempLeft && lastLeft < millis() - shakeTime)
  {
    Serial.println("######### LEFT ########");
    ResetInputs();
    leftActive = true;
  }
  if(tempRight && lastRight < millis() - shakeTime)
  {
    Serial.println("######### RIGHT ########");
    ResetInputs();
    rightActive = true;
  }
}

void ResetInputs()
{
  leftActive = false;
  rightActive = false;
  shakeActive = false;
  tempRight = false;
  tempLeft = false;
  lastLeft = 0;
  lastRight = 0;
  isShake = 0;
}

